# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-bleach
pkgver=6.0.0
pkgrel=2

pkgdesc="An easy whitelist-based HTML-sanitizing tool"
url="https://pypi.org/project/bleach/"
arch=('any')
license=('Apache')
depends=('python-packaging'
         'python-six'
         'python-webencodings')
makedepends=('python'
             'python-setuptools')
checkdepends=('python-pytest')
optdepends=('python-tinycss2: for CSS sanitisation')

source=(https://pypi.org/packages/source/b/bleach/bleach-$pkgver.tar.gz)

sha256sums=('1a1a85c1595e07d8db14c5f09f09e6433502c51c595970edc090551f0db99414')

prepare() {
	cd "$srcdir"/bleach-$pkgver
}

build() {
	cd "$srcdir"/bleach-$pkgver
	python setup.py build
}

# Upstream broke the test suite.
check() {
	cd "$srcdir"/bleach-$pkgver
	python -m pytest
}

package() {
	cd "$srcdir"/bleach-$pkgver
	python setup.py install --skip-build --optimize=1 --root="$pkgdir"
}
